package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {

        Scanner scanner=new Scanner(System.in);
        FileOutputStream fos=new FileOutputStream("note.txt",true);
        System.out.println("请输出");
        while (true){
        String line=scanner.nextLine();
        byte[]data=line.getBytes();
            if ("exit".equals(line)){
                break;
            }
            fos.write(data);
         }
        System.out.println("结束了");
        fos.close();
    }
}
